package com.zhao.dota.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhao.dota.model.Role;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMapper extends BaseMapper<Role> {


    @Select("select a.* from role a " +
            "  left join user_role b " +
            "    on a.id = b.role_id " +
            " where b.user_id = #{userId}")
    List<Role> findByUserId(Integer userId);

}
